
TRIGGER PROCEDURE FOR WRITE OF VD_MSTR OLD BUFFER OLD_VD_MSTR.


{mfdeclre.i }
define new shared work-table wf_old_vd_mstr like vd_mstr.

/* fdn 2004/10/28 Modify Record processing */
HK:
do:
    if can-find(first dt_mstr where dt_table = "vd_mstr" and dt_type = "SYNC") then
        run CreateSyncFlag(input "MOD", input recid(vd_mstr), input "vd_mstr").

    if not can-find ( first dt_mstr where dt_table = "vd_mstr" and dt_type = "MOD" ) then leave HK.
    
    if not can-find ( first wf_old_vd_mstr ) then do:
        create wf_old_vd_mstr.
        if recid(wf_old_vd_mstr)= -1 then .
    end.
    
    buffer-copy old_vd_mstr to wf_old_vd_mstr no-error.

    for each dt_mstr no-lock where dt_table = "vd_mstr" and dt_type = "MOD" :
    
        case dt_field :

            when "vd_addr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_addr, input vd_mstr.vd_addr,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_cr_terms" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_cr_terms, input vd_mstr.vd_cr_terms,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_buyer" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_buyer, input vd_mstr.vd_buyer,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_disc_pct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_disc_pct), input string(vd_mstr.vd_disc_pct),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_shipvia" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_shipvia, input vd_mstr.vd_shipvia,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_partial" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_partial), input string(vd_mstr.vd_partial),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_rmks" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_rmks, input vd_mstr.vd_rmks,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_ap_acct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_ap_acct, input vd_mstr.vd_ap_acct,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_ap_cc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_ap_cc, input vd_mstr.vd_ap_cc,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_pur_acct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_pur_acct, input vd_mstr.vd_pur_acct,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_pur_cc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_pur_cc, input vd_mstr.vd_pur_cc,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_pur_cntct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_pur_cntct, input vd_mstr.vd_pur_cntct,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_ap_cntct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_ap_cntct, input vd_mstr.vd_ap_cntct,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_1099" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_1099), input string(vd_mstr.vd_1099),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_sort" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_sort, input vd_mstr.vd_sort,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_last_ck" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_last_ck), input string(vd_mstr.vd_last_ck),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_balance" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_balance), input string(vd_mstr.vd_balance),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_hold" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_hold), input string(vd_mstr.vd_hold),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_tax_id" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_tax_id, input vd_mstr.vd_tax_id,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_taxable" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_taxable), input string(vd_mstr.vd_taxable),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_user1" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_user1, input vd_mstr.vd_user1,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_user2" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_user2, input vd_mstr.vd_user2,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_curr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_curr, input vd_mstr.vd_curr,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_lang" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_lang, input vd_mstr.vd_lang,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_vt_id" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_vt_id, input vd_mstr.vd_vt_id,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__chr01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__chr01, input vd_mstr.vd__chr01,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__chr02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__chr02, input vd_mstr.vd__chr02,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__chr03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__chr03, input vd_mstr.vd__chr03,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__chr04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__chr04, input vd_mstr.vd__chr04,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__chr05" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__chr05, input vd_mstr.vd__chr05,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__chr06" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__chr06, input vd_mstr.vd__chr06,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__chr07" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__chr07, input vd_mstr.vd__chr07,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__chr08" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__chr08, input vd_mstr.vd__chr08,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__chr09" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__chr09, input vd_mstr.vd__chr09,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__chr10" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__chr10, input vd_mstr.vd__chr10,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__dte01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__dte01), input string(vd_mstr.vd__dte01),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__dte02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__dte02), input string(vd_mstr.vd__dte02),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__dec01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__dec01), input string(vd_mstr.vd__dec01),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__dec02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__dec02), input string(vd_mstr.vd__dec02),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__log01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__log01), input string(vd_mstr.vd__log01),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_fob" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_fob, input vd_mstr.vd_fob,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_debtor" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_debtor, input vd_mstr.vd_debtor,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_bank" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_bank, input vd_mstr.vd_bank,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_ckfrm" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_ckfrm, input vd_mstr.vd_ckfrm,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_pay_spec" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_pay_spec), input string(vd_mstr.vd_pay_spec),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_remit" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_remit, input vd_mstr.vd_remit,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_type, input vd_mstr.vd_type,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_mod_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_mod_date), input string(vd_mstr.vd_mod_date),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_userid" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_userid, input vd_mstr.vd_userid,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_prepay" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_prepay), input string(vd_mstr.vd_prepay),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_conrep_logic" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_conrep_logic, input vd_mstr.vd_conrep_logic,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_pr_list" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_pr_list, input vd_mstr.vd_pr_list,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_fr_list" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_fr_list, input vd_mstr.vd_fr_list,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_fr_terms" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_fr_terms, input vd_mstr.vd_fr_terms,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_fr_min_wt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_fr_min_wt), input string(vd_mstr.vd_fr_min_wt),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_drft_bal" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_drft_bal), input string(vd_mstr.vd_drft_bal),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_lc_bal" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_lc_bal), input string(vd_mstr.vd_lc_bal),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_pr_list2" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_pr_list2, input vd_mstr.vd_pr_list2,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_fix_pr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_fix_pr), input string(vd_mstr.vd_fix_pr),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_tid_notice" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_tid_notice, input vd_mstr.vd_tid_notice,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_promo" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_promo, input vd_mstr.vd_promo,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_misc_cr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_misc_cr), input string(vd_mstr.vd_misc_cr),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_rcv_so_price" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_rcv_so_price), input string(vd_mstr.vd_rcv_so_price),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_rcv_held_so" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_rcv_held_so), input string(vd_mstr.vd_rcv_held_so),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_tp_use_pct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_tp_use_pct), input string(vd_mstr.vd_tp_use_pct),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_tp_pct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd_tp_pct), input string(vd_mstr.vd_tp_pct),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_ex_ratetype" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_ex_ratetype, input vd_mstr.vd_ex_ratetype,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_db" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_db, input vd_mstr.vd_db,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadc01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__qadc01, input vd_mstr.vd__qadc01,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadc02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__qadc02, input vd_mstr.vd__qadc02,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadc03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__qadc03, input vd_mstr.vd__qadc03,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadc04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd__qadc04, input vd_mstr.vd__qadc04,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadd01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__qadd01), input string(vd_mstr.vd__qadd01),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadd02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__qadd02), input string(vd_mstr.vd__qadd02),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadl01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__qadl01), input string(vd_mstr.vd__qadl01),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadl02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__qadl02), input string(vd_mstr.vd__qadl02),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadt01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__qadt01), input string(vd_mstr.vd__qadt01),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadt02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__qadt02), input string(vd_mstr.vd__qadt02),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadi01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__qadi01), input string(vd_mstr.vd__qadi01),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadi02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__qadi02), input string(vd_mstr.vd__qadi02),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadl03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__qadl03), input string(vd_mstr.vd__qadl03),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd__qadl04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_vd_mstr.vd__qadl04), input string(vd_mstr.vd__qadl04),
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_ap_sub" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_ap_sub, input vd_mstr.vd_ap_sub,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_pur_sub" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_pur_sub, input vd_mstr.vd_pur_sub,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "vd_tot_terms_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_vd_mstr.vd_tot_terms_code, input vd_mstr.vd_tot_terms_code,
                    input recid(vd_mstr), input vd_mstr.vd_addr, input "", input "", input "",
                    input "", input "", input "", input "").

        end.

    end.
end.

{hkdttrans.i}
